<html>
<head><meta charset="utf-8"><title>match-soundness · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html">match-soundness</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="126409328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409328">(May 11 2018 at 10:54)</a>:</h4>
<p>so <span class="user-mention" data-user-id="116083">@pnkfelix</span> ... the question is</p>



<a name="126409329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409329">(May 11 2018 at 10:54)</a>:</h4>
<p>(wait lets give <em>some</em> context for others)</p>



<a name="126409330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409330">(May 11 2018 at 10:54)</a>:</h4>
<p>I guess I agree it's probably nontrivial, but I feel like it might not be <em>that</em> hard to handle the <code>ref mut</code> case...</p>



<a name="126409331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409331">(May 11 2018 at 10:54)</a>:</h4>
<p>ok :)</p>



<a name="126409334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409334">(May 11 2018 at 10:54)</a>:</h4>
<p>niko and I are talking about <a href="https://github.com/rust-lang/rust/issues/27282" target="_blank" title="https://github.com/rust-lang/rust/issues/27282">https://github.com/rust-lang/rust/issues/27282</a></p>



<a name="126409344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409344">(May 11 2018 at 10:55)</a>:</h4>
<p>(I imagine <span class="user-mention" data-user-id="116106">@Reed Koser</span> would be interested in particular)</p>



<a name="126409345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409345">(May 11 2018 at 10:55)</a>:</h4>
<p>in particular, there are two avenues for handling the <code>ref mut</code> problem at the end of this comment: <a href="https://github.com/rust-lang/rust/issues/27282#issuecomment-384393383" target="_blank" title="https://github.com/rust-lang/rust/issues/27282#issuecomment-384393383">https://github.com/rust-lang/rust/issues/27282#issuecomment-384393383</a></p>



<a name="126409395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409395">(May 11 2018 at 10:57)</a>:</h4>
<p>Niko has long described handling this via a "hack" to ensure that the initial mut-borrow caused by the <code>ref mut</code> does not get treated as conflicting with the <code>FakeUse</code> of the shared-borrow of the match input.</p>



<a name="126409439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409439">(May 11 2018 at 10:58)</a>:</h4>
<p>but then ariel pointed out that what we want essentially amounts to another instance of two-phase borrows:</p>



<a name="126409440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409440">(May 11 2018 at 10:58)</a>:</h4>
<p>We want the <code>ref mut</code> to initially be a reservation of the matched location</p>



<a name="126409450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409450">(May 11 2018 at 10:59)</a>:</h4>
<p>and occurrences of the binding within the guard should <em>not</em> activate. This <em>is sound</em>, since they will be implicitly <code>&amp; &amp;mut</code> (a shared-borrow of a mut-borrow, which you cannot mutate through).</p>



<a name="126409451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409451">(May 11 2018 at 10:59)</a>:</h4>
<p>Niko and I both like this two-phase borrow approach to the issue</p>



<a name="126409502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409502">(May 11 2018 at 11:00)</a>:</h4>
<p>And then we were talking about just the question of how best to implement this. Right now two-phase borrows are only allowed for autorefs and operators</p>



<a name="126409513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409513">(May 11 2018 at 11:01)</a>:</h4>
<p>so we would need to increase the scope of that collection of forms that allow two-phase borrows. My question was, how much effort to put into an attempt to restrict it to this specific case.</p>



<a name="126409514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409514">(May 11 2018 at 11:01)</a>:</h4>
<p>so <a href="https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/build/matches/mod.rs#L939-L941" target="_blank" title="https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/build/matches/mod.rs#L939-L941">this is the function</a> that creates the temporaries for <code>ref mut</code> bindings, right? And, more specifically, <a href="https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/build/matches/mod.rs#L996-L1003" target="_blank" title="https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/build/matches/mod.rs#L996-L1003">this line</a>?</p>



<a name="126409520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409520">(May 11 2018 at 11:01)</a>:</h4>
<p>(Hmm, I see we create <em>two</em> temporaries, one for the guard and one for "realz", are we going to <em>recreate</em> the one "for realz" later if the guard is true, or just use it?)</p>



<a name="126409559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409559">(May 11 2018 at 11:02)</a>:</h4>
<p>If the latter, we would maybe have to tweak the two-phase system, since that would have more than one use</p>



<a name="126409562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409562">(May 11 2018 at 11:02)</a>:</h4>
<p>but .. hopefully not too hard to do</p>



<a name="126409565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409565">(May 11 2018 at 11:02)</a>:</h4>
<p>I believe we use the already created temporary</p>



<a name="126409569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409569">(May 11 2018 at 11:02)</a>:</h4>
<p>(and yes, I believe that you have correctly identified the relevant code.)</p>



<a name="126409572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409572">(May 11 2018 at 11:03)</a>:</h4>
<p>ok</p>



<a name="126409595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409595">(May 11 2018 at 11:03)</a>:</h4>
<p>But maybe the simplest thing would be to not reuse the already created temporary, but rather recreate it...</p>



<a name="126409596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409596">(May 11 2018 at 11:04)</a>:</h4>
<p>that would indeed be simple</p>



<a name="126409635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409635">(May 11 2018 at 11:04)</a>:</h4>
<p>at least w/r/t to the 2-phase borrow setup</p>



<a name="126409639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409639">(May 11 2018 at 11:04)</a>:</h4>
<p>I don't really recall how "baked in" the "single use" concept is, <em>but</em>, I am a bit nervous otherwise because</p>



<a name="126409640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409640">(May 11 2018 at 11:04)</a>:</h4>
<p>we don't want users to "see" the second phase I don't think</p>



<a name="126409641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409641">(May 11 2018 at 11:04)</a>:</h4>
<p>in particular:</p>



<a name="126409652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409652">(May 11 2018 at 11:05)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">match</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">   </span><span class="nb">Some</span><span class="p">(</span><span class="k">ref</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">       </span><span class="kd">let</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">foo</span><span class="p">;</span><span class="w"> </span><span class="c1">// should error, even if `x` is not later used</span>
<span class="w">   </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="126409653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409653">(May 11 2018 at 11:05)</a>:</h4>
<p>So I'll admit up front that I had been thinking I would have to mess around with the flag here: <a href="https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/hair/pattern/mod.rs#L484" target="_blank" title="https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/hair/pattern/mod.rs#L484">https://github.com/rust-lang/rust/blob/41707d8df9a441e19387a4a61415ee0af58a9e48/src/librustc_mir/hair/pattern/mod.rs#L484</a></p>



<a name="126409655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409655">(May 11 2018 at 11:05)</a>:</h4>
<p>so if we don't add a second borrow, then I think we would want to add an artificial use</p>



<a name="126409699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409699">(May 11 2018 at 11:06)</a>:</h4>
<p>I see, that's another option, but that would have a dramatic effect (unless we add those artificial uses :)</p>



<a name="126409700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409700">(May 11 2018 at 11:06)</a>:</h4>
<p>But it sounds like I might not have to mess with the hair, necessarily, since you have pointed out that there is already much magic injected during MIR generation and maybe I can just focus on adding more magic there</p>



<a name="126409701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409701">(May 11 2018 at 11:06)</a>:</h4>
<p>I could see merits to either approach. It might be confusing that the flag is false but the borrow is nonetheless 2-phase :)</p>



<a name="126409702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409702">(May 11 2018 at 11:06)</a>:</h4>
<p>at least a comment seems appropriate</p>



<a name="126409703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409703">(May 11 2018 at 11:07)</a>:</h4>
<p>wait</p>



<a name="126409709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409709">(May 11 2018 at 11:07)</a>:</h4>
<p>You really do want an error in that case above?</p>



<a name="126409710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409710">(May 11 2018 at 11:07)</a>:</h4>
<p>oh well</p>



<a name="126409711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409711">(May 11 2018 at 11:07)</a>:</h4>
<p>actually proably not because NLL</p>



<a name="126409712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409712">(May 11 2018 at 11:07)</a>:</h4>
<p>exactly</p>



<a name="126409717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409717">(May 11 2018 at 11:07)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">match</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">   </span><span class="nb">Some</span><span class="p">(</span><span class="k">ref</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">       </span><span class="kd">let</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">foo</span><span class="p">;</span><span class="w"> </span><span class="c1">// should error, even though `x` is not yet used</span>
<span class="w">       </span><span class="n">drop</span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="w">   </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="126409759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409759">(May 11 2018 at 11:08)</a>:</h4>
<p>now that I've discovered that <code>mem::drop</code> is in the prelude it's my new general purpose "read" primitive ;)</p>



<a name="126409762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409762">(May 11 2018 at 11:08)</a>:</h4>
<p>Okay, <em>now</em> we are in an interesting position</p>



<a name="126409765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409765">(May 11 2018 at 11:08)</a>:</h4>
<p>/me thinks about the new example</p>



<a name="126409775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409775">(May 11 2018 at 11:09)</a>:</h4>
<p>I guess going down that path eventually leads to the same counter-examples that led us to restrict two-phase borrows in the first place</p>



<a name="126409779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409779">(May 11 2018 at 11:09)</a>:</h4>
<p>you mean if we permitted that example above?</p>



<a name="126409780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409780">(May 11 2018 at 11:09)</a>:</h4>
<p>Yes</p>



<a name="126409782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409782">(May 11 2018 at 11:10)</a>:</h4>
<p>I would expect so, but there is an add'l reason, which is that I don't want to have to "teach" 2-phase borrows</p>



<a name="126409824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409824">(May 11 2018 at 11:10)</a>:</h4>
<p>Right right</p>



<a name="126409827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409827">(May 11 2018 at 11:10)</a>:</h4>
<p>at least not until people are asking pretty advanced questions :)</p>



<a name="126409829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409829">(May 11 2018 at 11:10)</a>:</h4>
<p>(but I think that these sorts of examples would be confusing early on, without much benefit...)</p>



<a name="126409833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409833">(May 11 2018 at 11:11)</a>:</h4>
<p>if we were going to go that way, I'd want to develop a more 'well-rounded' 2-phase system</p>



<a name="126409836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409836">(May 11 2018 at 11:11)</a>:</h4>
<p>and I guess we have our hands full right now :)</p>



<a name="126409880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126409880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126409880">(May 11 2018 at 11:12)</a>:</h4>
<p>brb gonna head out from my hotel, I think, and to a local cafe or some kind of "hipper" surroundings. In particular ones where there is decent coffee.</p>



<a name="126410280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126410280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126410280">(May 11 2018 at 11:26)</a>:</h4>
<blockquote>
<p>But maybe the simplest thing would be to not reuse the already created temporary, but rather recreate it...</p>
</blockquote>
<p>(on the flip side of this: I'm pretty sure there was a <em>reason</em> I did not take this approach from the outset. I.e. the way that the code is written, I had to do more work on the implementation side to avoid reuse. Maybe there was some move error resulting from the attempt to recreate? Or just attempting to reassign the temp was disallowed? I will find out...)</p>



<a name="126415653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126415653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126415653">(May 11 2018 at 13:49)</a>:</h4>
<p>this is why I'm trying to read all this — to learn and reteach</p>



<a name="126432860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126432860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126432860">(May 11 2018 at 20:40)</a>:</h4>
<p>guess who spent several rustc compile cycles adding <code>debug!</code> statements trying to figure out why his extensions to the two-phase borrow to include this match stuff didn't seem to be having any effect ... only to eventually realize/remember that <code>-Z borrowck=mir</code> does not currently imply <code>-Z two-phase-borrows</code>...</p>



<a name="126433331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126433331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126433331">(May 11 2018 at 20:51)</a>:</h4>
<p>on the plus side: I now have several more debug! statements to look at as I now debug my code for real. :)</p>



<a name="126434864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126434864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126434864">(May 11 2018 at 21:28)</a>:</h4>
<p>Oh, super interesting. I think my branch now works, including this new slight expansion of two phase borrows... The only problem (other than the diagnostics being non-ideal) is that I seem to have stopped triggering the unused mut lint in one case, namely this:</p>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="p">(</span><span class="mi">30</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">      </span><span class="p">(</span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="c1">//[lexical]~ ERROR: variable does not need to be mutable</span>
<span class="w">                   </span><span class="c1">//[nll]~^ ERROR: variable does not need to be mutable</span>
<span class="w">      </span><span class="p">(</span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"></span>
<span class="w">      </span><span class="p">(</span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">      </span><span class="p">}</span><span class="w"></span>
<span class="w">      </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="126434875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126434875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126434875">(May 11 2018 at 21:29)</a>:</h4>
<p>Which is super weird; I wonder if its because I slightly altered the MIR codegen so that the variables get constructed on the arm body itself...</p>



<a name="126435905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126435905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126435905">(May 11 2018 at 21:50)</a>:</h4>
<p>Hmm... fixed that particular example, but now its made me start exploring the test space around multiple patterns on one arm, and I'm starting to doubt whether extending two-phase borrows for this case is as trivial as we had thought...</p>



<a name="126435976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126435976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126435976">(May 11 2018 at 21:53)</a>:</h4>
<p>e.g. a case like</p>
<div class="codehilite"><pre><span></span><span class="w">   </span><span class="k">match</span><span class="w"> </span><span class="p">(</span><span class="mi">30</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">      </span><span class="p">(</span><span class="k">ref</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w">  </span><span class="p">(</span><span class="mi">30</span><span class="p">,</span><span class="w"> </span><span class="k">ref</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">)</span><span class="w">  </span><span class="k">if</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">      </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>is now going to have multiple definition sites for <code>x</code>. And for the guard, they'll want to each be borrows of distinct locations on the matched input...</p>



<a name="126435981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126435981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126435981">(May 11 2018 at 21:53)</a>:</h4>
<p>But now its almost midnight so I think its time for me to put this away</p>



<a name="126437708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126437708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126437708">(May 11 2018 at 22:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> the unused mut lint does have some .. oddities as well</p>



<a name="126613727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126613727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126613727">(May 15 2018 at 21:36)</a>:</h4>
<p>woot: <a href="https://github.com/rust-lang/rust/pull/50783" target="_blank" title="https://github.com/rust-lang/rust/pull/50783">https://github.com/rust-lang/rust/pull/50783</a></p>



<a name="126613743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126613743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126613743">(May 15 2018 at 21:37)</a>:</h4>
<p>(and now time for me to get ready for bed)</p>



<a name="126614241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/126614241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#126614241">(May 15 2018 at 21:48)</a>:</h4>
<p>Nice</p>



<a name="127227131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/127227131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#127227131">(May 29 2018 at 00:39)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> btw I think I’m done revising 50783 so you can just double check my note about whether you had already reviewed the extension to two-phase borrows</p>



<a name="127239871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/127239871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#127239871">(May 29 2018 at 08:12)</a>:</h4>
<p>ok</p>



<a name="127240545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/127240545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#127240545">(May 29 2018 at 08:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> by "the extension to two-phase borrows", do you mean <a href="https://github.com/rust-lang/rust/pull/50783/commits/ab17cd4696bf73018e2d9b2cbbbb00705dcc14b3" target="_blank" title="https://github.com/rust-lang/rust/pull/50783/commits/ab17cd4696bf73018e2d9b2cbbbb00705dcc14b3">this commit</a>? That is, considering a use <em>solely</em> in a borrow to not activate?</p>



<a name="127240643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/127240643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#127240643">(May 29 2018 at 08:32)</a>:</h4>
<p>Is that ab17cd4 ? It looks like it (and that is the correct one, at the current rebase state )</p>



<a name="127240727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/match-soundness/near/127240727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/match-soundness.html#127240727">(May 29 2018 at 08:34)</a>:</h4>
<p>it is</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>